Skip to content

[6.x] Share the blueprint and creating state with addons in the publish form - #16010

Open
marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:cp-context-for-addons
Open

marcorieser wants to merge 1 commit into
statamic:6.xfrom
marcorieser:cp-context-for-addons

Conversation

@marcorieser

@marcorieser marcorieser commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

I'm building an addon that fills in a field's default from the value of another field. In the publish form it needs to know whether the item is being created (new content gets its defaults, existing content is left alone) and which blueprint it is working with. Its setting in the field editor also needs a picker for the other fields. None of that is available to an addon today: the publish-container-created event has no blueprint, nothing says whether the item is new, and config fieldtypes can't see the fields of the blueprint being edited.

This adds:

  • an isCreating prop on the publish container. The entry, term, global, user group, page and new user forms pass it. It is provided in the container context and included in the publish-container-created payload.
  • blueprint in the publish-container-created payload. It was already in the context.
  • a suggestableConditionFieldsProvider in the field settings editor, the same key the blueprint builder provides, so a config fieldtype can suggest the other fields the way the Conditions tab does.

isCreating is false unless a form passes it.

Includes tests for the container.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant